package com.yunsoft.gateway.interceptor.bean;

import com.yunsoft.gateway.interceptor.InterceptorAdapter;
import java.io.Serializable;
import java.util.Arrays;

public class WebInterceptorBean implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private InterceptorAdapter adapter;
	/**
	 * 过滤器名称
	 * @return
	 */
	private String name;
	/**
	 * 排序，值越小越先执行，从零开始
	 * @return
	 */
	private int order;
	/**
	 * 要拦截的地址
	 * @return
	 */
	private String[] pathPatterns;
	/**
	 * 要排除的地址
	 * @return
	 */
	private String[] excludePathPatterns;
	
	/**
	 * preHandler执行结果
	 */
	private boolean preHandle;
	
	
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder("");
		builder.append("[");
		builder.append("name:"+name+",");
		builder.append("order:"+order+",");
		builder.append("pathPatterns:"+Arrays.toString(pathPatterns)+",");
		builder.append("excludePathPatterns:"+Arrays.toString(excludePathPatterns)+",");
		builder.append("class:"+adapter.getClass().getName());
		builder.append("]");
		return builder.toString();
	}
	
	public boolean isPreHandle() {
		return preHandle;
	}

	public void setPreHandle(boolean preHandle) {
		this.preHandle = preHandle;
	}

	public InterceptorAdapter getAdapter() {
		return adapter;
	}
	public void setAdapter(InterceptorAdapter adapter) {
		this.adapter = adapter;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getOrder() {
		return order;
	}
	public void setOrder(int order) {
		this.order = order;
	}
	public String[] getPathPatterns() {
		return pathPatterns;
	}
	public void setPathPatterns(String[] pathPatterns) {
		this.pathPatterns = pathPatterns;
	}
	public String[] getExcludePathPatterns() {
		return excludePathPatterns;
	}
	public void setExcludePathPatterns(String[] excludePathPatterns) {
		this.excludePathPatterns = excludePathPatterns;
	}
	
	
	
	
}
